﻿using Unity.Entities;
using Unity.Mathematics;
using UnityEngine;

/// <summary>
/// 挂gameObject上，它转化为Entity时，会执行这个转化，并将entity的组件附加上去
/// </summary>
public class RotateSpeedAuthoring_IJobEntityBatch : MonoBehaviour, IConvertGameObjectToEntity
{
    public float DegressPerSecond = 360.0f;
    
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        var com = new RotateSpeed_IJobEntityBatch() { RadiansPerSecond = math.radians(DegressPerSecond) };
        dstManager.AddComponentData(entity, com);
    }
}